package se.webbzon.boltzmann.game.object.spawner;

import se.webbzon.boltzmann.battle.environment.BattleEnvironment;
import se.webbzon.boltzmann.battle.property.BattlePropertyFactoryGroup;
import se.webbzon.boltzmann.environment.AbstractEnvironment;
import se.webbzon.boltzmann.environment.EnvironmentInflator;
import se.webbzon.oschi01.worldeditor.WorldObjectDeflation;
import se.webbzon.oschi01.worldobject.WorldObject;

public class HostileNPCSpawnerInflator extends EnvironmentInflator {
	
	// An optional battle environment (only required when debug is not running)
	private final BattleEnvironment benv;
	
	// The battle property factory group associated with this inflator
	private final BattlePropertyFactoryGroup factoryGroup;

	/*============================================================
	Constructors
	============================================================*/
	
	public HostileNPCSpawnerInflator(	AbstractEnvironment env, 
										BattlePropertyFactoryGroup factoryGroup) {
		this(env,null,factoryGroup);
	}
	
	public HostileNPCSpawnerInflator(	AbstractEnvironment env, 
										BattleEnvironment benv,
										BattlePropertyFactoryGroup factoryGroup) {
		super(env,HostileNPCSpawner.worldObjectName);
		this.benv = benv;
		this.factoryGroup = factoryGroup;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public WorldObject makeWorldObject(WorldObjectDeflation deflation) {
		return ((HostileNPCSpawnerDeflation) deflation).
				createSpawnerOrNPC(getEnvironment(), benv, factoryGroup);
	}

	@Override public WorldObjectDeflation makeDeflation(int deflationProperties, WorldObject[] dependencies) {
		return new HostileNPCSpawnerDeflation(deflationProperties);
	}

}
